package p18.p2020;

import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;

public class FileCopy {
    public static void main(String[] args) throws IOException {
        FileInputStream fis = new FileInputStream("D:\\1\\a.log");
        FileOutputStream fos = new FileOutputStream("D:\\2\\b.log");

/*        int by = 0;
        while ((by=fis.read()) != -1) {
            fos.write(by);
        }*/
/*        int by = 0;
        boolean a = true;
        while (a) {
            by = fis.read();
            if (by != -1) {
                fos.write(by);
            } else {
                a = false;
            }
        }*/

        int by = 0;
        while ((by = fis.read()) != -1) {
            fos.write(by);

        }
/*        int red = fis.read();
        while (red != -1) {
         fos.write(red);*/
        // fos.close();
        // fis.close();
    }
}
